pict-section-form 1.1.9 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +1 -1
- package/README.md +1 -1
- package/docs/Configuration.md +1 -0
- package/docs/Layouts.md +60 -0
- package/docs/_version.json +3 -3
- package/docs/examples/README.md +1 -1
- package/docs/examples/change_tracking/change_tracking.js +322 -20
- package/docs/examples/diagram_form/diagram_form_example.min.js +2 -2
- package/docs/examples/dynamic_analysis/dynamic_analysis_application.js +301 -20
- package/docs/examples/gradebook/README.md +43 -1
- package/docs/examples/gradebook/gradebook_application.min.js +2 -2
- package/docs/examples/ndt_field_test/ndt_field_test.js +322 -20
- package/docs/examples/richtext_form/richtext_form_example.min.js +2 -3
- package/docs/examples/scope_mathematics/scope_mathematics.js +322 -20
- package/docs/examples/simple_table/README.md +1 -0
- package/docs/examples/simple_table/simple_tabular_application.min.js +2 -2
- package/docs/examples/superhero_studio/superhero_studio_example.min.js +2 -3
- package/docs/index.html +2 -2
- package/docs/retold-catalog.json +1 -1
- package/docs/retold-keyword-index.json +10252 -9612
- package/example_applications/complex_table/Complex-Tabular-Application.js +5 -0
- package/example_applications/gradebook/Gradebook-Application.js +19 -4
- package/example_applications/gradebook/package.json +2 -2
- package/example_applications/simple_table/README-SimpleTable.md +9 -0
- package/example_applications/simple_table/Simple-Tabular-Application.js +6 -1
- package/package.json +1 -1
- package/source/providers/layouts/Pict-Layout-Custom.js +13 -0
- package/source/providers/layouts/Pict-Layout-Record.js +13 -0
- package/source/providers/layouts/Pict-Layout-Tabular.js +639 -1
- package/source/providers/layouts/Pict-Layout-VerticalRecord.js +13 -0
- package/source/services/ManifestFactory.js +8 -0
- package/test/PictSectionForm-Tabular-Features_tests.js +293 -0
package/.vscode/settings.json
CHANGED
package/README.md
CHANGED
|
@@ -291,7 +291,7 @@ Live, runnable example applications - click to open one in your browser:
|
|
|
291
291
|
| Example | Description |
|
|
292
292
|
|---------|-------------|
|
|
293
293
|
| [Simple Table](https://fable-retold.github.io/pict-section-form/examples/simple_table/) | Tabular layout, reference manifests, and dot-notation access into nested data |
|
|
294
|
-
| [Gradebook](https://fable-retold.github.io/pict-section-form/examples/gradebook/) | Stacked headers, row labels, dynamic columns, row/column selection, and
|
|
294
|
+
| [Gradebook](https://fable-retold.github.io/pict-section-form/examples/gradebook/) | Stacked headers, row labels, dynamic columns, row/column selection, sorting, and the persistent column chooser |
|
|
295
295
|
| [Scope Mathematics](https://fable-retold.github.io/pict-section-form/examples/scope_mathematics/) | Solvers that reach across sections and the global form scope |
|
|
296
296
|
| [Change Tracking](https://fable-retold.github.io/pict-section-form/examples/change_tracking/) | A change-detecting solver state machine with bidirectional recompute |
|
|
297
297
|
| [NDT Field Test](https://fable-retold.github.io/pict-section-form/examples/ndt_field_test/) | Offline persistence, pick lists, pass/fail row solvers, and charts |
|
package/docs/Configuration.md
CHANGED
|
@@ -101,6 +101,7 @@ See [Layouts](Layouts.md) for full details and examples.
|
|
|
101
101
|
| `RowSelection` | boolean/object | Add row checkboxes; selection persists in form data |
|
|
102
102
|
| `ColumnSelection` | boolean/object | Add column checkboxes; selection persists in form data |
|
|
103
103
|
| `ColumnSorting` | boolean | Add clickable sort controls to the prime header cells (default off) |
|
|
104
|
+
| `ColumnChooser` | boolean/object | Opt-in "Columns" menu to hide/show columns; the hidden set persists in form data |
|
|
104
105
|
|
|
105
106
|
### Layout Types
|
|
106
107
|
|
package/docs/Layouts.md
CHANGED
|
@@ -330,6 +330,66 @@ works for both static and dynamic columns (dynamic columns sort by their
|
|
|
330
330
|
`InformaryDataAddress` value). Values that parse as numbers sort numerically;
|
|
331
331
|
others sort lexically.
|
|
332
332
|
|
|
333
|
+
### Column Chooser
|
|
334
|
+
|
|
335
|
+
`ColumnChooser` (off by default - the feature is strictly **opt-in**) puts a
|
|
336
|
+
right-aligned **Columns** button above the table. Clicking it opens a menu of
|
|
337
|
+
checkboxes, one per column; unchecking a column hides it, checking it brings
|
|
338
|
+
it back. When columns are hidden the button reads `Columns (n hidden)` so the
|
|
339
|
+
user always knows part of the table is tucked away.
|
|
340
|
+
|
|
341
|
+
The hidden set is **stored in the form data** as an array of column hashes
|
|
342
|
+
(default address `<GroupHash>_HiddenColumns`), so - exactly like
|
|
343
|
+
`RowSelection` state - it round-trips with save / load: reload the saved form
|
|
344
|
+
data and the table comes back with the same columns hidden. When a host loads
|
|
345
|
+
form data carrying a different hidden set than the table was rendered with,
|
|
346
|
+
the layout detects the difference on marshal and rebuilds automatically.
|
|
347
|
+
|
|
348
|
+
Set it to `true` for defaults, or to an object:
|
|
349
|
+
|
|
350
|
+
| Property | Type | Description |
|
|
351
|
+
|----------|------|-------------|
|
|
352
|
+
| `Enabled` | boolean | Set `false` to disable (same as omitting) |
|
|
353
|
+
| `DataAddress` | string | Where the hidden-column-hash array is stored (default `<GroupHash>_HiddenColumns`) |
|
|
354
|
+
| `ButtonLabel` | string | Trigger button text (default `"Columns"`) |
|
|
355
|
+
| `DefaultHiddenColumns` | array | Column hashes hidden until the user changes visibility |
|
|
356
|
+
|
|
357
|
+
```json
|
|
358
|
+
{
|
|
359
|
+
"Layout": "Tabular",
|
|
360
|
+
"RecordSetAddress": "Assignments",
|
|
361
|
+
"ColumnChooser": true
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
A column can also start hidden via its descriptor: set
|
|
366
|
+
`PictForm.TabularDefaultHidden: true` and the column renders hidden until the
|
|
367
|
+
user shows it through the menu. Defaults (both forms) apply only while the
|
|
368
|
+
user has made **no** choice - they never write to the form data on their own.
|
|
369
|
+
The first checkbox the user toggles persists the full hidden set explicitly,
|
|
370
|
+
and the menu's **Reset to defaults** button writes the configured default set
|
|
371
|
+
back.
|
|
372
|
+
|
|
373
|
+
Behavioral guarantees:
|
|
374
|
+
|
|
375
|
+
- **Hiding never touches record data.** A hidden column's values stay in the
|
|
376
|
+
record set (same non-destructive invariant as `DynamicColumns`) and reappear
|
|
377
|
+
when the column is shown again.
|
|
378
|
+
- **The last visible column cannot be hidden** - the checkbox snaps back.
|
|
379
|
+
- **Stacked headers stay aligned.** User-supplied `Headers` rows shrink their
|
|
380
|
+
`ColumnSpan` past hidden columns (cells covering only hidden columns drop
|
|
381
|
+
out), and `HeaderGroupTemplate` super-headers re-cluster over the visible
|
|
382
|
+
columns.
|
|
383
|
+
- **Dynamic columns are choosable too** and persist by their generated hash,
|
|
384
|
+
so a hidden dynamic column stays hidden across data reloads that regenerate
|
|
385
|
+
it.
|
|
386
|
+
- **Statically hidden columns** (`PictForm.TabularHidden`) never appear in the
|
|
387
|
+
menu - they are configuration, not user preference.
|
|
388
|
+
|
|
389
|
+
The chooser composes with `ColumnSorting`, `RowSelection` / `ColumnSelection`,
|
|
390
|
+
`Headers`, `RowLabels`, and `DynamicColumns`; the gradebook example
|
|
391
|
+
application exercises all of them together.
|
|
392
|
+
|
|
333
393
|
## RecordSet Layout
|
|
334
394
|
|
|
335
395
|
Similar to tabular but renders each record as a full form section rather
|
package/docs/_version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Name": "pict-section-form",
|
|
3
|
-
"Version": "1.
|
|
3
|
+
"Version": "1.2.0",
|
|
4
4
|
"Description": "Pict dynamic form sections",
|
|
5
|
-
"GeneratedAt": "2026-06-
|
|
6
|
-
"GitCommit": "
|
|
5
|
+
"GeneratedAt": "2026-06-12T03:16:33.010Z",
|
|
6
|
+
"GitCommit": "877094e"
|
|
7
7
|
}
|
package/docs/examples/README.md
CHANGED
|
@@ -101,7 +101,7 @@ node ServeExamples.js
|
|
|
101
101
|
| [Change Tracking](change%5Ftracking/README.md) | Intermediate | Demonstrates the multi-input evaluate-on-change solver pattern for reacting to several fields at once. | [Launch](examples/change%5Ftracking/index.html) |
|
|
102
102
|
| [Diagram Form Input](diagram%5Fform/README.md) | Intermediate | A pict-section-form field whose InputType is Diagram — boots in view mode (inline SVG, theme-recolorable), toggles into edit mode (Excalidraw) on demand. Demonstrates the themeify pipeline: change the --diagram-* CSS variables and the view-mode SVG visibly re-colors without a re-render. | [Launch](examples/diagram%5Fform/index.html) |
|
|
103
103
|
| [Dynamic Analysis](dynamic%5Fanalysis/README.md) | Advanced | A fruit-nutrition analysis lab with dynamic section injection, solver rewriting, charts, and histograms. | [Launch](examples/dynamic%5Fanalysis/index.html) |
|
|
104
|
-
| [Gradebook](gradebook/README.md) | Intermediate | An advanced tabular recordset with stacked headers, row labels, dynamic columns, row/column selection, and column
|
|
104
|
+
| [Gradebook](gradebook/README.md) | Intermediate | An advanced tabular recordset with stacked headers, row labels, dynamic columns, row/column selection, column sorting, and a persistent column chooser — built purely from manifest configuration. | [Launch](examples/gradebook/index.html) |
|
|
105
105
|
| [NDT Field Test](ndt%5Ffield%5Ftest/README.md) | Advanced | A nuclear-density-testing field data-collection form with offline persistence and charted results. | [Launch](examples/ndt%5Ffield%5Ftest/index.html) |
|
|
106
106
|
| [RichText Form Input](richtext%5Fform/README.md) | Intermediate | A pict-section-form field whose InputType is RichText — boots in view mode (rendered markdown), toggles into edit mode (CodeMirror) on demand. Demonstrates the AllowImages knob and the pluggable ImageUploader override. | [Launch](examples/richtext%5Fform/index.html) |
|
|
107
107
|
| [Scope Mathematics](scope%5Fmathematics/README.md) | Intermediate | Shows solvers reaching across scopes to read and combine data from other sections of the form. | [Launch](examples/scope%5Fmathematics/index.html) |
|